package com.feicheng.controller;

import com.feicheng.base.result.Result;
import com.feicheng.service.ProviderProcurementController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author clin.song
 * @since 2022-06-27
 */
@RestController
@RequestMapping("/purchase")
public class PurchaseDetailController {

    @Autowired
    ProviderProcurementController providerProcurementController;

    /**
     * 门店采购订单详情接口
     *
     * @param purchaseHeaderId 采购头主键
     * @return
     * @autor clin.song
     */
    @GetMapping ("/detail/page")
    public Result getPurchaseDetail(
            Integer purchaseHeaderId,
            @RequestParam(defaultValue = "1") Integer current,
            @RequestParam(defaultValue = "10") Integer size) {
        return Result.success(providerProcurementController.getPurchaseDetail(purchaseHeaderId,current,size));
    }
}
